#include "cmodel.h"

#define _load_feature_map_from_file(t, p) load_feature_map_from_file(t, "txt_param/"p)
#define _load_kernel_from_file(t, p) load_kernel_from_file(t, "txt_param/"p)

int main(int argc, char const *argv[])
{
    featureMap a, b, out;
    int len;
    float err;

    debug("---------------------------------------------------------------------------------------\n");
    _load_feature_map_from_file(&a, "a_mat_add_test.txt");
    _load_feature_map_from_file(&b, "b_mat_add_test.txt");
    _load_feature_map_from_file(&out, "out_s1p1k3_test.txt");


    debug("mat_add test\t");
    debug("a:[%d,%d,%d]\t",a.channels, a.width, a.height);
    debug("b:[%d,%d,%d]\t",b.channels, b.width, b.height);
    debug("out:[%d,%d,%d]\n",out.channels, out.width, out.height);
    mat_add(&a, &b);
    err = 0.0;
    len = out.channels * out.width * out.height;
    for (int i = 0; i < len; i++)
    {
        err += POW2(a.data[i] - out.data[i]);
    }
    debug("err:%f\n", err);

    return 0;
}
